{extend name="platform/base" /} 
{block name="resources"/}
<style>
.right-indent:after{
	content:'';
	display:inline-block;
	width:20%;
}
</style>
{/block} 
{block name="main"}
<section class="panel panel-default">
	<div class="table-responsive">
		<table class="table table-striped b-light text-sm">
			<colgroup>
					<col style="width: 9%;">
					<col style="width: 9%;">
					<col style="width: 9%;">
					<col style="width: 9%;">
					<col style="width: 9%;">
					<col style="width: 9%;">
					<col style="width: 10%;">
					<col style="width: 9%;">
					<col style="width: 10%;">
					<col style="width: 18%;">
				</colgroup>
				<thead>
					<tr>
						<th>用户名称</th>						
						<th class="center">金额类型</th>
						<th class="right">商品卖价</th>
						<th class="right">商品成本</th>								
						<th class="right">商品利润</th>
						<th class="right">商品分销比率</th>
						<th class="right">推广员分佣比率</th>
						<th class="right">佣金金额</th>								
						<th class="center">发放状态</th>						
						<th class="center">时间</th>
					</tr>
				</thead>
				<tbody id="myTable"></tbody>
		</table>
	</div>
	{include file="platform/page" /}
</section>

<!-- 修改用户上级（Modal）结束 -->
{/block} {block name="script"}
<script type="text/javascript">	
	//查询
	$(function(){
	LoadingInfo(1);
});
	function LoadingInfo(pageIndex) {
		var type_id = "{$type_id}";
		var uid = "{$uid}";
		$.ajax({
			type : "post",
			url : '{:__URL("PLATFORM_MAIN/Commission/userAccountRecordsDetail")}',
			async : true,
			data : {
				"pageIndex" : pageIndex, 
				"type_id":type_id,
				"uid":uid
			},
			success : function(data) {
				var html = '';
				$("#total_count_num").text(data["total_count"]);
				$("#page_count_num").text(data["page_count"]);
				$("#page_count").val(data["page_count"]);
				$("#pageNumber a").remove();
				if (data["data"].length > 0) {
					for (var i = 0; i < data["data"].length; i++) {
						
						html += '<tr align="center">';	
						html += '<td align="left">' + data["data"][i]['userinfo']["nick_name"]+ '<br> ' + data["data"][i]['prometerinfo']["promoter_no"]+ '</td>';									
						html += '<td>' + data["data"][i]["type_name"]+ '</td>';
						
						html += '<td align="right">' + data["data"][i]['account_info']["goods_money"]+ '</td>';
						html += '<td align="right">' + data["data"][i]['account_info']["goods_cost"]+ '</td>';						
						html += '<td align="right">' + data["data"][i]['account_info']["goods_return"]+ '</td>';	
						html += '<td align="right">' + data["data"][i]['account_info']["goods_commission_rate"]+ ' %</td>';	
						html += '<td align="right">' + data["data"][i]['account_info']["commission_rate"]+ ' %</td>';					
						html += '<td align="right">' + parseFloat(data["data"][i]["money"]).toFixed(2) + '</td>';
						
						if(data["data"][i]['account_info']["is_issue"] == 1)
						{
							html += '<td>已发放</td>';
						}
						else
						{
							html += '<td>未发放</td>';
						}
						
						
						html += '<td>' + timeStampTurnTime(data["data"][i]["create_time"]) + '</td>';					
						html += '</tr>';
					}
				} else {
					html += '<tr align="center"><td colspan="9">暂无符合条件的数据记录</td></tr>';
				}
				console.log(html);
				$("#myTable").html(html);
					var totalpage = $("#page_count").val();
			if (totalpage == 1) {
				changeClass("all");
			}
			var $html = pagenumShow(jumpNumber,totalpage,{$pageshow})
			$("#pageNumber").append($html);
			}
		});
	}
	
	//全选
	function CheckAll(event){
		var checked = event.checked;
		$(".style0list tbody input[type = 'checkbox']").prop("checked",checked);
	}
	

</script>
{/block}
